package presentation.windowsFackData;

import javax.swing.JFrame;
import javax.swing.WindowConstants;


/**
 * a frame wrapper for the ViewThreadPanel
 */
public class ViewThreadFrameFakeWrapper extends JFrame
{
	private static final long serialVersionUID = 3772672502716881562L ;
	
	private ViewThreadFakePanel threadPanel;
	
	/**
	 * create a wrapper JFrame for the given viewThreadPanel
	 * @param viewThreadPanel the panel to wrap
	 */
	public ViewThreadFrameFakeWrapper(ViewThreadFakePanel viewThreadPanel){
		super();
		this.threadPanel = viewThreadPanel;
		this.setTitle("Topic: "+this.threadPanel.getPresentThread().getTopic());
		this.getContentPane().add(this.threadPanel);
		this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		this.pack();
	}
	
	
	/**
	 * @see java.awt.Window#dispose()
	 */
	@Override
	public void dispose()
	{
		super.dispose() ;
		this.threadPanel.closeOpenSubFrames();
	}
	
}
